home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / jumpext.zip / JUMPEXT.DOC < prev    next >
Text File  |  1989-06-21  |  9KB  |  202 lines

  1.  
  2.  
  3.                                    JumpExt
  4.  
  5.                              V1.0    19-Jun-1989
  6.     
  7.                  Copyright (C) 1989 by Simple Solutions, Inc.
  8.                              All Rights Reserved
  9.  
  10.                              A Shareware Product
  11.                                      from
  12.  
  13.                             Simple Solutions, Inc.
  14.                                P.O. Box 640189
  15.                                Kenner, LA 70064
  16.                                 (504) 464-5748
  17.  
  18.                                   Written by
  19.                               Mark W. Geisinger
  20.  
  21.                                  CIS 76440,76
  22.                               GEnie M.GEISINGER
  23.  
  24.  
  25. JumpExt comes from a need I have to do some decision making in my autoexec.bat
  26. file and, as the name implies, is an extension of the original utility, Jump,
  27. which I released into the public domain.
  28.  
  29. JumpExt retains the original flavor of Jump, in that it allows you to do some
  30. simple decision making in batch files (with a time-out default) based on the
  31. error level set by the program.  JumpExt provides some extensions to the
  32. original program which I hope you will find useful.
  33.  
  34. Jump-Ext is a copyrighted work and has been released for distribution as
  35. SHAREWARE.  Please read the file LICENSE.DOC before using Jump-Ext.
  36.  
  37. Usage:
  38. ------
  39.  
  40. JumpExt should be executed in the following manner:
  41.  
  42.         jumpext [-b [-f param_filename] ] prompt
  43.         
  44.         Brackets indicate optional parameters.
  45.  
  46.     Parameters:
  47.  
  48.         -b  Bell
  49.  
  50.             Is a switch which will cause JumpExt to sound the all to
  51.             irritating bell when it is executed.  The default is off,
  52.             that is no bell or other noise is made.
  53.  
  54.         -f Use Action file
  55.  
  56.             JumpExt is capable of executing a program based on info in
  57.             a action file.  When used this switch requires the
  58.             complete pathname (including the filename) to the action
  59.             file (ie. -f c:\bin\param.jmp).  You may use any legal filename
  60.             you choose, which allows for as many of these action files
  61.             as you may have a need for when using JumpExt several times or
  62.             in several batch files.  This file is simply a text file and
  63.             its use is fully explained below.
  64.  
  65.         prompt
  66.  
  67.             This is a text prompt that you pass to JumpExt and it uses
  68.             as its user prompt when executed.  Enclose the text of the
  69.             prompt in double quotes if there are embedded spaces.
  70.  
  71.  
  72. JumpExt operates in the following manner.  When executed, it will display the
  73. prompt on the screen and check for a single key input (the letter 'y', in
  74. upper or lower case is what it looks for) from the user.  This is done by
  75. first checking the keyboard buffer for a waiting keystroke.  If there is one,
  76. action is taken based on that key.  This allows you to enter your response to
  77. JumpExt before it is actually executed (in a running batch file of course). 
  78. If there is no waiting keystroke a timing loop is begun while waiting for a
  79. response.  This timer waits approximately 7 sec. on a 13 mhz. AT (your milage
  80. will surely vary).  Entering a keystroke or timing out causes the next
  81. action.
  82.  
  83. What JumpExt does next is based on keyboard input and the command line
  84. switches passed to the program.  The simplest case is where JumpExt is called
  85. with only the prompt parameter.  Typing the letter 'y' (case insensitive) at
  86. the keyboard will cause JumpExt to exit to DOS, setting the errorlevel to 1. 
  87. Timing out or any other keyboard response will cause JumpExt to exit with
  88. errorlevel set to 0.  You may then use the errorlevel value for branching in
  89. your batch file.  If the -f switch was used and you type 'y' at the keyboard,
  90. then JumpExt operates on the action file.  Using the -f switch and any other
  91. keyboard response or timing out causes JumpExt to exit to DOS with errorlevel
  92. set to 0.
  93.  
  94.  
  95. Consider this fragment from my autoexec file:
  96.  
  97.     jumpext "Skip installation of resident programs? "
  98.     if errorlevel 1 goto nores
  99.     c:\bin\fastbuff /b50/v5/d4
  100.     c:\bin\newkeys
  101.     MIRROR c: d: e: /1 /tc /td-400 /te-400 /tf /tg >nul
  102.     PC-CACHE /IA /IB /SIZEXT=384K >nul
  103.     :nores
  104.     continues here....
  105.  
  106. What happens here is that answering the prompt in the affirmative ('y')
  107. causes execution of the batch file to jump to the "nores" label, skipping the
  108. stuff above.  Any other response, or just ignoring it while you get another
  109. cup of coffee, causes the execution of the lines after the "if errorlevel"
  110. statement (what I usually want done).
  111.  
  112. You will notice that the prompt is enclosed in quotes.  This is necessary is
  113. you wish to have embedded spaces in your prompt (which will normally be the
  114. case).
  115.  
  116. Another example of how to use JumpExt:
  117.  
  118. jumpext -b -f c:\bin\jumpext.prm "Install Norton Guides? "
  119.  
  120. This line is the second usage of JumpExt in my autoexec.bat file.  In this
  121. case, I use the -b switch to wake me up and the -f switch for an action
  122. filename. If I do nothing, or respond with a key other than 'y', then JumpExt
  123. exits with errorlevel set to 0.  if I respond with a 'y', then the first line
  124. in the action file is used to execute a program.  In this particular case, my
  125. action file simply contains single line necessary to install the Norton
  126. Guides.  I take no further action in the batch file for this usage of
  127. JumpExt.
  128.  
  129. Consider the single key response and your own personal prompts, and you'll
  130. see that this allows for considerable flexibility.  If you use prompts and
  131. resulting actions that allow for your most frequent response to be other than
  132. the affirmative 'y', you can be lazy like me and just slap the space bar or
  133. ignore the program most of the time.  For example, I usually want the
  134. resident stuff installed, so a prompt that asks if I want to skip this
  135. installation of resident utilities and the logic used in the batch file allow
  136. me to be lazy most of the time.
  137.  
  138. Action Files:
  139. -------------
  140.  
  141. The Action file is simply a text file which JumpExt uses to get a command
  142. line used to execute another program.  In its present form JumpExt uses the
  143. first line of the Action file only.  This line is expected to be a command
  144. line used to execute a program or another utility.  JumpExt will execute this
  145. other program for you, using the command line in the Action file.  You may
  146. create the Action file with any text editor or word processor capable of
  147. saving a file as ASCII text.  The first line of the file should be the
  148. command line used to start the program you want executed and should be
  149. entered exactly as you would enter it at the DOS prompt.
  150.  
  151. At this point JumpExt is capable of executing a single program from the
  152. Action file.  It has occurred to me that it may be desirable to have several
  153. other options available to you.  For instance, control does not return to
  154. JumpExt after executing a program for you.  In fact, JumpExt is removed from
  155. memory when the other program is run.  While there are certainly instances
  156. where this is desirable (when installing a TSR for instance), I've considered
  157. that it may be useful to allow JumpExt to execute as many commands as you
  158. like from the Action file. It may also be useful to allow you to use JumpExt
  159. and an Action file to run more than one program or execute regular DOS
  160. commands.
  161.  
  162. I would be interested in your opinion on the usefulness of these ideas, and
  163. certainly any other suggestions or comments you may have about JumpExt.  If
  164. there is something you would like JumpExt to do, let me know.  If I get
  165. enough interest in a particular feature or enhancement chances are that it
  166. will appear in a future version.
  167.  
  168. A word on TSRs and JumpExt:
  169. ---------------------------
  170.  
  171. TSRs may be the single most useful and sometimes unpredictable class of
  172. programs around.  I use JumpExt regularly to install the Norton Guides from
  173. an Action file, as shown in the example above.  I have also tested it with
  174. the other major TSR package that I use, PC-TOOLS V5.1.  I haven't encountered
  175. any problems installing these resident programs with Ju